package com.example.spring.bean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @Author: zhangrongqing
 * @Date: 2020/7/16 20:06
 */
@Component("myFactoryBean")
public class MyFactoryBean implements FactoryBean {
    public void test(){
        System.out.println(this.getClass().getName());
    }

    @Override
    public Object getObject() throws Exception {
        return new TestBean();
    }

    @Override
    public Class<?> getObjectType() {
        return TestBean.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
